Conditions | 1 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {google} from 'googleapis'; |
||
2 | |||
3 | /** |
||
4 | * Create google api credentials |
||
5 | * |
||
6 | * @returns {object} google.chat |
||
7 | */ |
||
8 | function gAuth() { |
||
9 | // Use default credentials (service account) |
||
10 | const credentials = new google.auth.GoogleAuth({ |
||
11 | // keyFile: path.join(__dirname, '../../tests/creds.json'), |
||
12 | scopes: ['https://www.googleapis.com/auth/chat.bot'], |
||
13 | }); |
||
14 | return google.chat({ |
||
15 | version: 'v1', |
||
16 | auth: credentials, |
||
17 | }); |
||
46 |